
void	mcreate_op(	mmu_op *op,
					mmu_action acts,
					mmu_source source,
					mmu_target ctarget,
					sim_addr addr,
					mmu_amode atype) {
	op->action = acts;
	
}

int		mop_mapaddr(	HOST *h,
						mmu_op *op) {
	mmu_error err;
	mmu_prot prot;
	mmu_priv ring;

	if(err = translate_address(h, op->loc, &op->loc, &prot)) {
		return err;
	}
	op->a_type = TYPE_PADDR;

	return E_OKAY;
}

int		mq_mapaddr(		HOST *h,
						mmu_op *op) {
	if(!POLICY_TEST(h, POLICY_MAP_TLB) || POLICY_TEST(h, POLICY_INSTANT_TLB)) {
		return mop_mapaddr(h, op);
	}
	mmu_pushq(M_TLBQ(h), op);

	return E_MMU_STALL;
}

int		mop_cacheread(	HOST *h,
						mmu_op *op,
						mmu_cache *c) {
	switch(op->a_type) {
	case TYPE_VADDR:
		return cache_read_addr(c->cache, op->loc, NULL, op->length, op->data);
	case TYPE_INDEX:
		return cache_read_index(c->cache, op->loc, NULL, op->length, op->data);
	}
	return E_INVALID;
}

int		mq_cacheread(	HOST *h,
						mmu_op *op,
						mmu_cache *c) {
	mmu_pushq(c->q, op);
	return E_MMU_STALL;
}

int		mop_cachewrite(	HOST *h,
						mmu_op *op,
						mmu_cache *c) {
	switch(op->a_type) {
	case TYPE_VADDR:
		return cache_write_addr(
}
